<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="decorator" content="default" />
	<title>第二类疫苗接种情况报表6-2</title>
	<style>
		#exportTable {text-align: center; }
		#exportTable td,th{padding: 5px 10px 5px 10px !important; }
		#exportTable .title{font-size: 20px;}
		#exportTable .b{font-weight: bold;}
		#exportTable .subtitle{font-size: 16px; font-weight: normal;}
		#exportTable .text-left{text-align: left !important;}
		#exportTable .text-right{text-align: right !important;}
		#exportTable .tips{line-height: 16px; font-size: 14px;}
		.table-ctn{
			border:solid 1px black;
			border-collapse:collapse;
			margin-top:40px;
		}
		.table-ctn th , .table-ctn td {
			text-align:center;
			padding:6px 8px!important;
			font-size:14px;
		}
		.w200{ width:200px; }
		.w100{ width:100px; }
	</style>
	<script src='http://localhost:8000/CLodopfuncs.js'></script>
	<script type="text/javascript" src="${ctxStatic}/js/LodopFuncs.js"></script>
	<script type="text/javascript" src="${ctxStatic}/js/ExportExcel.js"></script>
	<c:if test="${not empty arg }">
		<script type="text/javascript">			
			$(function(){
				layer.msg('你输入的时间格格式有误',{icon: 2});
			})
		</script>		
	</c:if>
<script type="text/javascript">
$(document).ready(function(){
	for(var i=2008;i<2051 ;i++){
		$("#timeyear").append("<option value="+i+">"+i+"</option>");//添加option
		$("#timeyear").val(${yearstr});
	}
	for(var i=1;i<=12 ;i++){
		$("#timemonth").append("<option value="+i+">"+i+"</option>");//添加option
		$("#timemonth").val(${monthstr});
	}
});

function goback(){
	window.location.href="${ctx}/export/export/exportlist";
}

function print1(){
	$("#notPrint").css("display","none");
	window.print();
}
 
$(function(){
		//表格1
	var html1 = '<table class="table-ctn" border="1">'+
		         	'<thead>'+
					'<tr><th colspan="4" style="font-size:20px;">#yearstr#年#monthstr#月常规免疫接种情况汇总表</th></tr>'+
					'<tr><th colspan="4" style="font-size:16px;">#sheng#&emsp;#shi#&emsp;#qu#&emsp;相南办&emsp;#off#</th></tr>'+
					'<tr><th class="">疫苗名称</th><th class="">接种针次数</th><th class="">疫苗名称</th><th class="">接种针次数</th></tr>'+ 
					'</thead>'+
					'<tbody>'+
						'#shujv#'+
						'<tr><td colspan="4"  class="tips text-left">填写说明：本表用于全人群第二类疫苗接种情况报告；乡级防保组织每月5日前汇总上报县级疾病预防控制机构，<br>&emsp;&emsp;&emsp;&emsp;&emsp;县级疾病预防控制机构每月10日前录入上报国家信息管理平台。</td></tr>'+
						'<tr><td colspan="4" class="text-left">填报日期：#date# &emsp;&emsp;&emsp;填报单位：#off1# &emsp;&emsp;&emsp;&emsp;填报人：#username#</td></tr>'+
					'</tbody>'+
		     '</table>';
	//表格4数据展示
	var arr = eval(${maps});
	html1 = html1.replace("#yearstr#","${yearstr}").replace("#monthstr#", "${monthstr}").replace("#date#","${date}")
		.replace("#sheng#","${sheng}").replace("#shi#","${shi}").replace("#qu#","${qu}").replace("#off1#", "${off}").replace("#username#", "${username}").replace("#off#", "${off}");
	var shujv_temp = '<tr><td>#name1#</td><td>#num1#</td><td>#name2#</td><td>#num2#</td></tr>';
	var bubian_temp = shujv_temp;
	var temp_html = "";
	if(arr.length%2==0){
		for(var i=0;i<arr.length;i+=2){
			shujv_temp = bubian_temp;
			shujv_temp = shujv_temp.replace("#name1#",arr[i].name).replace("#num1#",arr[i].num).replace("#name2#",arr[i+1].name).replace("#num2#",arr[i+1].num);
			temp_html += shujv_temp;
		}
	}else{
		for(var i=0;i<arr.length-1;i+=2){
			shujv_temp = bubian_temp;
			shujv_temp = shujv_temp.replace("#name1#",arr[i].name).replace("#num1#",arr[i].num).replace("#name2#",arr[i+1].name).replace("#num2#",arr[i+1].num);
			temp_html += shujv_temp;
		}
		shujv_temp = bubian_temp;
		shujv_temp = shujv_temp.replace("#name1#",arr[arr.length-1].name).replace("#num1#",arr[arr.length-1].num).replace("#name2#","").replace("#num2#","");
		temp_html += shujv_temp;
	}
	html1 = html1.replace("#shujv#", temp_html);
	$("#tablediv").html(html1);
}); 
</script>
</head>
<body>	
	<div id="notPrint">
		<form:form id="searchForm" modelAttribute="export" action="${ctx}/export/export/typeTwoVaccReport6_2" method="post" class="form-inline">
			<form:hidden path="id"/>
			<div class="input-group" >
				<table style="margin-top:15px;">
					<tr>
						<td>
							<select id="timeyear" name="yearstr" class="form-control"/></select>
						</td>
						<td>&nbsp;&nbsp;年&nbsp;&nbsp;</td>
						<td>
							<select id="timemonth" name="monthstr" class="form-control"></select>
						</td>
						<td>&nbsp;&nbsp;月&nbsp;&nbsp;</td>
						<td>
							<input id="btnSubmit" style="margin-left:50px;" class="btn btn-primary" type="submit" value="统计" />&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
						<td>
							<button class="btn btn-primary" onclick="print1()">打印</button>&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
						<td>
							<a class="btn btn-primary" onclick="SaveAsFile('第二类疫苗接种情况报表6-2')">导出</a>&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
						<td>
							<a class="btn btn-default" href="javascript:goback()">返回</a>&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
					</tr>
				</table>
			</div>
		</form:form>
	</div>
	<div id="tablediv">
	
	</div>
</html>